<?php

/* @project : Template
 * @auther  : 大梦
 * @date    : 2020/12/08
 * @desc    : 员工信息
 */

namespace app\common\model;

class Staff extends Base
{
    protected $autoWriteTimestamp = true;

    /**
     * 获取员工列表
     * @author Meng
     * @dateTime 2020-12-10
     * @return   [type]     [description]
     */
    public function getStaffList()
    {
        $where_staff = [
            ['is_valid', 'eq', 1],
            ['status', 'eq', 1],
            ['is_del', 'eq', 0],
        ];
        $list    = $this->where($where_staff)->order('id asc')->order('sort asc')->select();
        return $list->toArray();
    }

    /**
     * 解析入职时间
     * @author Meng
     * @dateTime 2020-12-09
     * @return   [type]     [description]
     */
    public function getEntryTimeAttr($value, $data)
    {
        return $value;
        // return date('Y-m-d', $value);
    }
}
